package ar.com.photo_admin.domain

class Notification extends DomainObject {
	
	String description

	String associatedUrl
	
	Set userNotifications
	
	static hasMany = [ userNotifications : UserNotification ]
	
    static constraints = {
		description nullable:false
		associatedUrl nullable:true
    }
	
	Notification addToUserNotifications(User user) {
		UserNotification.link(user, this)
		return this
	}
	
	Notification removeFromUserNotifications(User user) {
		UserNotification.unlink(user, this)
		return this
	}
}
